const { VantResolver } = require('@vant/auto-import-resolver')
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
module.exports = {
	publicPath: '/',
	devServer: {
		client: {
			overlay: false,
		},
		proxy: {
			'/oisys': {
				target: 'http://localhost:8088',
				ws: true,
				changeOrigin: true, //允许跨域
				// pathRewrite: {
				// 	'^/api/': '', // 调用时用api替代根路径
				// },
			},
		},
	},
	transpileDependencies: true,
	configureWebpack: {
		plugins: [
			//当 unplugin-vue-components 版本大于等于 0.26.0 时，使用以下写法
			AutoImport.default({
				resolvers: [VantResolver()],
			}),
			Components.default({ resolvers: [VantResolver()] }),
		],
	},
}
